package com.offcn.bigdata.util.db;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisUtil {
    private static JedisPool pool;

    static  {
        JedisPoolConfig conf = new JedisPoolConfig();
        pool = new JedisPool(conf, "bigdata01", 6379);
    }
    public static Jedis getJedis() {
        return pool.getResource();
    }

    public static void release(Jedis jedis) {
        jedis.close();
    }
}
